package com.lujianfei.ann.base;

import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;

import com.lujianfei.lib.window.BaseInternalWindow;

public class BaseChildWindow extends BaseInternalWindow {

	public interface OnCloseListener {
		void onClose(Object frame);
	}

	protected OnCloseListener onCloseListener = null;

	public void setOnCloseListener(OnCloseListener onCloseListener) {
		this.onCloseListener = onCloseListener;
	}

	public BaseChildWindow(int width, int height) {
		super(width, height);
		setResizable(true); // 设置允许自由调整窗体大小
		setClosable(true); // 设置提供“关闭”按钮
		setIconifiable(true); // 设置提供“最小化”按钮
		setMaximizable(true); // 设置提供“最大化”按钮
		addComponentListener(new ComponentListener() {

			@Override
			public void componentShown(ComponentEvent e) {
			}

			@Override
			public void componentResized(ComponentEvent e) {
				onResize();
			}

			@Override
			public void componentMoved(ComponentEvent e) {
			}

			@Override
			public void componentHidden(ComponentEvent e) {
			}
		});
	}
	
	protected void onResize() {
		
	}
}
